<extend name="Public:base"/>
<block name="title"> 武汉同兴一站办企业服务有限公司 管理中心 - 添加文章 </block>

<block name="header">
    <span class="action-span"><a href="#">优惠券添加</a></span>
    <span class="action-span1"><a href="#">武汉同兴一站办企业服务有限公司 管理中心</a></span>
    <!--   <span id="search_id" class="action-span1"> - 添加分类 </span>-->
    <div style="clear:both"></div>
</block>
<block name="body">

    <form action="{:U('Couponentity/edit')}" method="post" name="my_form" id="my_form" enctype="multipart/form-data">
        <table width="100%" id="general-table">
            <input type="hidden" value="{$res.entity_coupon_id}" name="entity_coupon_id">
            <tr>
                <td class="label">赞助商名称:</td>
                <td>
                    <input type='text' name='sponsor_id' maxlength="20" value='{$res.sponsor_id}' size='27' /> <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">优惠券名称:</td>
                <td>
                    <input type='text' name='coupon_name' maxlength="20" value='{$res.coupon_name}' size='27' /> <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">优惠券介绍:</td>
                <td>
                    <input type='text' name='intro' maxlength="20" value='{$res.intro}' size='27' /> <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">兑换所需积分:</td>
                <td>
                    <input type='text' name='integral' maxlength="20" value='{$res.integral}' size='27' /> <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">VIP所专属:</td>
                <td>
                    <select id="sel" name="vip_exclusive" style="width:150px">
                        <option value="0">普通优惠券</option>
                        <option value="1">VIP1以上可以兑换</option>
                        <option value="2">VIP2以上可以兑换</option>
                        <option value="3">VIP3以上可以兑换</option>
                        <option value="4">VIP4以上可以兑换</option>
                        <option value="5">VIP5以上可以兑换</option>
                        <option value="6">VIP6以上可以兑换</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="label">开始领取时间:</td>
                <td>
                    <input type="datetime-local" name="start_time" value="{$res.start_time}">
                </td>
            </tr>
            <tr>
                <td class="label">结束领取时间:</td>
                <td>
                    <input type="datetime-local" name="end_time" value="{$res.end_time}">
                </td>
            </tr>

            <tr>
                <td class="label">可以使用时间:</td>
                <td>
                    <input type='text' name='use_time' maxlength="20" value="{$res.use_time}" size='27'/>天 <font color="red">*</font>
                </td>
            </tr>

            <tr>
                <td class="label">失效类型:</td>
                <td>
                    <input type="radio" name="lost_type" value="0" onclick="hah()" <if condition="$res.lost_type eq 0">checked</if> >定期失效
                    <input type="radio" name="lost_type" value="1" onclick="hah1()" <if condition="$res.lost_type eq 1">checked</if>>周期性失效
                </td>
            </tr>
            <tr id="lost_time" >
                <td class="label" >定期失效时间:</td>
                <td>
                    <input type='datetime-local' name='lost_time' value="{$res.lost_time}"/>
                </td>
            </tr>
            <tr id="lost" >
                <td class="label"  >周期失效时间:</td>
                <td>
                    <input type='text' name='lost_cycle'  value="{$res.lost_cycle}"/>天
                </td>
            </tr>

            <tr>
                <td class="label">优惠券数量:</td>
                <td>
                    <input type='text' name='coupon_num' maxlength="20" value='{$res.coupon_num}' size='27' /> <font color="red">*</font>
                </td>
            </tr>
            <tr>
                <td class="label">优惠券状态:</td>
                <td>

                    <input type="radio" name="state" value="1" <if condition="$res.state eq 1">checked</if>>启用
                    <input type="radio" name="state" value="0" <if condition="$res.state eq 0">checked</if>>禁用
                </td>
            </tr>



        </table>
        <div class="button-div">
            <input type="submit" value=" 确定 " />
        </div>
    </form>

    <script>

        document.getElementById("sel")[{$res.vip_exclusive}].selected=true;
        if ({$res.lost_type}==0) {
        document.getElementById("lost").style.display='none';
        }else{
        document.getElementById("lost_time").style.display='none';
        }
        function hah() {
            document.getElementById("lost_time").style.display='';
            document.getElementById("lost").style.display='none';
        }
        function hah1() {
            document.getElementById("lost").style.display='';
            document.getElementById("lost_time").style.display='none';
        }


    </script>
    <script type="text/javascript" src="/public/Admin/JS/jquery.min.js"></script>
    <script type="text/javascript" src="/public/Admin/JS/mydate.js"></script>
</block>





